Skip to content

Render Headroom savings as a table instead of a dense sentence - #53

Merged
Mearman merged 1 commit into
mainfrom
fix/headroom-comment-table
Sep 10, 2026
Merged

Render Headroom savings as a table instead of a dense sentence#53
Mearman merged 1 commit into
mainfrom
fix/headroom-comment-table

Conversation

@Mearman

@Mearman Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member

The Step Summary and PR comment both crammed request count, tokens saved, and two distinct compression percentages into one run-on sentence, e.g. "proxied 20 request(s), saving 24542 tokens, 1.1% of all tokens sent this run (1.7% average per-request compression)". Easy to conflate the two percentages at a glance. Renders both as a small "Metric | Value" markdown table instead, one row per figure.

Test plan

  • Extracted the modified step's real run: script via yaml.safe_load(), ran it against a fake local /stats server seeded with the exact figures from the last live dogfood run, confirmed the Step Summary table and outputs render correctly
  • Rendered the PR comment's printf with the same values to confirm the markdown table body is well-formed
  • actionlint via the synthetic workflow_call wrapper: no new findings at the two modified steps
  • npm run lint / typecheck / format:check all pass

…sentence

The Step Summary and PR comment both packed request count, tokens saved,
and two distinct compression percentages into one run-on sentence, making
the two figures easy to conflate at a glance. Render both as a small
"Metric | Value" table instead, so each number has its own labelled row.
@Mearman
Mearman marked this pull request as ready for review September 10, 2026 08:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-10T08:28:27.253634Z 67c39ef Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal, well-tested change. action.yml is the only file touched, and both edits are purely presentational: the "Verify Headroom actually proxied this run" Step Summary block and the "Post Headroom savings comment" PR-comment body now render the proxied-count/tokens-saved/aggregate-savings/average-compression figures as a 4-row GFM table instead of a dense sentence. No logic, variable computation, or interpolated-value sourcing changed — PROXIED_COUNT, TOKENS_SAVED, TOTAL_PERCENT_SAVED, and COMPRESSION_PCT/COMPRESSION_PERCENT are still derived identically from Headroom's own local, loopback-bound /stats response, so nothing untrusted is newly rendered.

Checked:

  • Both new tables have a blank line before the header row and a correctly formed | --- | --- | delimiter row, so they'll render as tables rather than plain text in both the Step Summary and the PR comment.
  • The $MARKER HTML comment used for the sticky-comment dedup logic is still appended after the table, unchanged.
  • No prior reviews or inline comments exist on this PR (first review) — nothing stale to reconcile.
  • No related tracking issue found that this PR should close.
  • Title and description are already specific and complete (exact change named, before/after example, concrete test plan) — no update needed.

No Should-fix or Blocker findings. Approving.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sound, minimal, purely presentational change. Only action.yml is touched, in the two spots (action.yml:1734-1743, action.yml:1798) that render Headroom's proxied-count/tokens-saved/aggregate/average-compression figures — the dense-sentence format becomes a "Metric | Value" GFM table in both the Step Summary and the sticky PR comment. No variable computation or value sourcing changed; PROXIED_COUNT, TOKENS_SAVED, TOTAL_PERCENT_SAVED, and COMPRESSION_PCT/COMPRESSION_PERCENT are still read from the same local, loopback-bound Headroom /stats response as before.

Checked:

  • Both tables have a blank line before the header row and a valid | --- | --- | delimiter, so they render as GFM tables rather than plain text.
  • This is independently confirmed correct, not just by reading the YAML: this PR's own "🗜️ Headroom context compression" comment on this thread was produced by this exact code path on this exact commit, and it renders the intended table cleanly.
  • The $MARKER HTML comment used for sticky-comment dedup is still appended unchanged after the table.
  • Title and description are specific and complete (names the exact before/after, includes a concrete test plan) — no update needed.
  • No tracking issue found for this change; branch name and commit message don't reference one.

This PR's head commit (67c39ef) is identical to the commit already reviewed and approved by claude[bot] — this is a duplicate trigger on the same revision, not a new commit, so there's nothing stale to reconcile and no re-verification of a prior finding applies here.

One process note: gh pr list / gh issue list were both blocked by permission in this run, so I could not independently check for related open PRs or a tracking issue beyond what's visible in this PR's own metadata; nothing in the diff itself suggested either was needed.

No Should-fix or Blocker findings.

@github-actions

Copy link
Copy Markdown

🗜️ Headroom context compression

Metric Value
Requests proxied 15
Tokens saved 19064
Aggregate savings 1.1% of all tokens sent
Average per-request compression 1.6%

@Mearman
Mearman merged commit 2ce3f6b into main Sep 10, 2026
15 of 16 checks passed
@Mearman
Mearman deleted the fix/headroom-comment-table branch September 10, 2026 08:38
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant